{% extends 'base.html' %}
{% load static %}

{% block title %}积分规则 - 本地有约{% endblock %}

{% block content %}
<div class="container py-4">
    <div class="row justify-content-center">
        <div class="col-lg-8">
            <div class="card">
                <div class="card-header bg-primary text-white">
                    <h4 class="mb-0"><i class="fas fa-gift me-2"></i>积分规则</h4>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th>行为</th>
                                    <th>积分</th>
                                    <th>每日上限</th>
                                    <th>说明</th>
                                </tr>
                            </thead>
                            <tbody>
                                {% for rule in rules %}
                                <tr>
                                    <td>{{ rule.get_rule_type_display }}</td>
                                    <td><span class="badge bg-success">+{{ rule.points }}</span></td>
                                    <td>{% if rule.daily_limit %}{{ rule.daily_limit }}次{% else %}无限制{% endif %}</td>
                                    <td>{{ rule.description }}</td>
                                </tr>
                                {% empty %}
                                <tr>
                                    <td colspan="4" class="text-center text-muted py-4">
                                        暂无积分规则
                                    </td>
                                </tr>
                                {% endfor %}
                            </tbody>
                        </table>
                    </div>

                    <!-- 积分说明 -->
                    <div class="mt-4 p-3 bg-light rounded">
                        <h6><i class="fas fa-info-circle me-2"></i>积分说明</h6>
                        <ul class="mb-0">
                            <li>积分可以用于兑换奖励、提升等级</li>
                            <li>等级提升后会解锁更多特权</li>
                            <li>积分永久有效，不会过期</li>
                            <li>如有疑问，请联系客服</li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}